//
//  CCBaseTableViewVC.swift
//  swift_weibo
//
//  Created by ccl on 16/2/24.
//  Copyright © 2016年 LittleBoy. All rights reserved.
//
import UIKit

class CCBaseTableViewVC: UITableViewController, VirstorViewDelegate {
    /// 标记是否是游客登录
    var isVistor = shareUserAccount == nil;
    var virstorView : CCVirstorView?
    
   override func loadView() {
   
  
    if (isVistor == true){
    
        setVistorView();
    }else{
      
        super.loadView();
    }

        
    }
    
    
    override func viewDidLoad() {
        super.viewDidLoad()
        isVistor = true;
        
        
    }
    
///  设置游客登录界面
    func setVistorView(){
       
        virstorView = CCVirstorView();
        virstorView?.delegate = self;
        view = virstorView! ;
        self.navigationItem.leftBarButtonItem = UIBarButtonItem(title: "注册", style: UIBarButtonItemStyle.Plain, target: self, action: "leftBarBtnDidClick:");
        self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: "登录", style: UIBarButtonItemStyle.Plain, target: self, action: "rightBarBtnDidClick:");
        
    
    }
    
     func leftBarBtnDidClick(sender : UIButton){
    
        print(__FUNCTION__);
        
    }
    
     func rightBarBtnDidClick(sender : UIButton) {
        print(__FUNCTION__);
    }
    
    
    func VirstorViewloginBtnDidClick(virstor: UIView, btn: UIButton) {
        
        let userLogin = CCUserLoginVC();
        let nav = UINavigationController(rootViewController: userLogin);
        presentViewController(nav, animated: true, completion: nil);
    }
    func VirstorViewRegistBtnDidClick(virstor: UIView, btn: UIButton) {
       
        print(__FUNCTION__);
    }
}
